package com.briup.sms.service.impl;

import com.briup.sms.dao.CategoryMapper;
import com.briup.sms.entity.Category;
import com.briup.sms.entity.extend.CategoryExtend;
import com.briup.sms.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author :xuyang
 * @DateTime:2023/12/27 11:15
 * @Version :v1.0.0
 * ClassName:CategoryServiceImpl
 * Package  :com.briup.sms.service.impl
 * Description:TODO
 */
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    CategoryMapper mapper;

    @Override
    public List<CategoryExtend> findCategoryInfo() {
        return mapper.findCategoryInfo();
    }

    @Override
    public List<Category> findCategoryOneLevel() {
        return mapper.findCategoryOneLevel();
    }

    @Override
    public List<CategoryExtend> findCategoryByOneLevel(Integer id) {
        return mapper.findCategoryByOneLevel(id);
    }

    @Override
    public void addCategory(Category category) {
        mapper.addCategory(category);
    }

    @Override
    public List<Category> findByName(String name) {
        return mapper.findByName(name);
    }

    @Override
    public void delete(Integer id) {
        mapper.delete(id);
    }
}
